package nancal.mp.db.mongo.table

import java.io.*
import nbcp.base.db.*
import nbcp.base.comm.*
import nbcp.base.extend.*
import nbcp.base.enums.*
import nbcp.base.utils.*
import nbcp.myoql.db.*
import nbcp.myoql.db.comm.*
import nbcp.myoql.db.enums.*
import nbcp.myoql.db.mongo.*
import nbcp.myoql.db.mongo.base.*
import nbcp.myoql.db.mongo.component.*
import org.slf4j.LoggerFactory
import org.springframework.stereotype.*


@Component("mongo.dev")
@MetaDataGroup(DatabaseEnum.Mongo, "dev")
class DevGroup : IDataGroup {
    override fun getEntities(): Set<BaseMetaData<out Any>> = setOf(apiDefine, apiDefineProfile, apiExecTest, apiInterceptor, apiStory, appDeployPipelineHook, appDeploySetting, clusterInfo, dataEnum, dataModel, dbConnection, deploySheet, devopsTemplateFile, esConnection, gitData, gitFolderDeployLock, gitServer, jenkinsLog, jenkinsOpsLog, mongoConnection, opsBuildQueue, parameterModel, productLine, userDockerfile, userK8sDeployment)


    /**
     * Api定义
     */
    val apiDefine get() = ApiDefineEntity();



    /**
     * ApiProfile
     */
    val apiDefineProfile get() = ApiDefineProfileEntity();



    /**
     * Api测试
     */
    val apiExecTest get() = ApiExecTestEntity();



    /**
     * Api全局拦截器
     */
    val apiInterceptor get() = ApiInterceptorEntity();



    /**
     * Api故事
     */
    val apiStory get() = ApiStoryEntity();




    val appDeployPipelineHook get() = AppDeployPipelineHookEntity();



    /**
     * 应用部署设置服务器
     */
    val appDeploySetting get() = AppDeploySettingEntity();



    /**
     * 集群
     */
    val clusterInfo get() = ClusterInfoEntity();



    /**
     * 枚举
     */
    val dataEnum get() = DataEnumEntity();



    /**
     * Api模型
     */
    val dataModel get() = DataModelEntity();



    /**
     * 关系型数据连接
     */
    val dbConnection get() = DbConnectionEntity();



    /**
     * 发布单
     */
    val deploySheet get() = DeploySheetEntity();




    val devopsTemplateFile get() = DevopsTemplateFileEntity();



    /**
     * Es数据连接
     */
    val esConnection get() = EsConnectionEntity();



    /**
     * Git仓库
     */
    val gitData get() = GitDataEntity();



    /**
     * Git发版锁定
     */
    val gitFolderDeployLock get() = GitFolderDeployLockEntity();



    /**
     * Git服务器
     */
    val gitServer get() = GitServerEntity();




    val jenkinsLog get() = JenkinsLogEntity();




    val jenkinsOpsLog get() = JenkinsOpsLogEntity();



    /**
     * Mongo数据连接
     */
    val mongoConnection get() = MongoConnectionEntity();



    /**
     * 应用部署设置服务器
     */
    val opsBuildQueue get() = OpsBuildQueueEntity();



    /**
     * 参数模型
     */
    val parameterModel get() = ParameterModelEntity();



    /**
     * 产品线
     */
    val productLine get() = ProductLineEntity();




    val userDockerfile get() = UserDockerfileEntity();




    val userK8sDeployment get() = UserK8sDeploymentEntity();


    /**
     * Api定义
     */
    @nbcp.base.db.annotation.Cn(value = """Api定义""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class ApiDefineEntity(collectionName: String = "apiDefine") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.ApiDefine>(nancal.mp.db.mongo.entity.dev.ApiDefine::class.java, collectionName) {

        val id = MongoColumnName("_id")

        /**
         * 名称
         */
        @nbcp.base.db.annotation.Cn(value = """名称""") 
        val name = MongoColumnName("name")

        /**
         * 产品线
         */
        @nbcp.base.db.annotation.Cn(value = """产品线""") 
        val productLine = CodeNameMeta("productLine")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

        /**
         * 应用
         */
        @nbcp.base.db.annotation.Cn(value = """应用""") 
        val app = MongoColumnName("app")

        /**
         * 模块
         */
        @nbcp.base.db.annotation.Cn(value = """模块""") 
        val group = MongoColumnName("group")

        /**
         * 地址
         */
        @nbcp.base.db.annotation.Cn(value = """地址""") 
        val url = MongoColumnName("url")

        /**
         * HTTP方法
         */
        @nbcp.base.db.annotation.Cn(value = """HTTP方法""") 
        val httpMethod = MongoColumnName("httpMethod")

        /**
         * 请求头中的参数
         */
        @nbcp.base.db.annotation.Cn(value = """请求头中的参数""") 
        val requestHeaderParameters = ApiSimpleParameterDefineMeta("requestHeaderParameters")

        /**
         * 请求体参数
         */
        @nbcp.base.db.annotation.Cn(value = """请求体参数""") 
        val requestBodyParameters = ApiBodyParameterDefineMeta("requestBodyParameters")

        /**
         * 请求地址中path中的参数
         */
        @nbcp.base.db.annotation.Cn(value = """请求地址中path中的参数""") 
        val requestUrlPathParameters = ApiSimpleParameterDefineMeta("requestUrlPathParameters")

        /**
         * 请求地址中的查询参数
         */
        @nbcp.base.db.annotation.Cn(value = """请求地址中的查询参数""") 
        val requestUrlQueryParameters = ApiSimpleParameterDefineMeta("requestUrlQueryParameters")

        /**
         * 响应体参数
         */
        @nbcp.base.db.annotation.Cn(value = """响应体参数""") 
        val responseBodyParameters = ApiBodyParameterDefineMeta("responseBodyParameters")

        /**
         * 响应头中的参数
         */
        @nbcp.base.db.annotation.Cn(value = """响应头中的参数""") 
        val responseHeaderParameters = ApiSimpleParameterDefineMeta("responseHeaderParameters")

        /**
         * 备注
         */
        @nbcp.base.db.annotation.Cn(value = """备注""") 
        val remark = MongoColumnName("remark")

    }

    /**
     * ApiProfile
     */
    @nbcp.base.db.annotation.Cn(value = """ApiProfile""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class ApiDefineProfileEntity(collectionName: String = "apiDefineProfile") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.ApiDefineProfile>(nancal.mp.db.mongo.entity.dev.ApiDefineProfile::class.java, collectionName) {

        val id = MongoColumnName("_id")

        /**
         * 名称
         */
        @nbcp.base.db.annotation.Cn(value = """名称""") 
        val name = MongoColumnName("name")

        val createBy = IdNameMeta("createBy")

        val apiId = MongoColumnName("apiId")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * Api测试
     */
    @nbcp.base.db.annotation.Cn(value = """Api测试""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class ApiExecTestEntity(collectionName: String = "apiExecTest") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.ApiExecTest>(nancal.mp.db.mongo.entity.dev.ApiExecTest::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val apiDefine = ApiDefineMeta("apiDefine")

        val host = MongoColumnName("host")

        val authorization = MongoColumnName("authorization")

        val headers = MongoColumnName("headers")

        val parameters = MongoColumnName("parameters")

        val status = MongoColumnName("status")

        val responseHeader = MongoColumnName("responseHeader")

        val responseBody = MongoColumnName("responseBody")

        val createBy = IdNameMeta("createBy")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * Api全局拦截器
     */
    @nbcp.base.db.annotation.Cn(value = """Api全局拦截器""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class ApiInterceptorEntity(collectionName: String = "apiInterceptor") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.ApiInterceptor>(nancal.mp.db.mongo.entity.dev.ApiInterceptor::class.java, collectionName) {

        val id = MongoColumnName("_id")

        /**
         * 名称
         */
        @nbcp.base.db.annotation.Cn(value = """名称""") 
        val name = MongoColumnName("name")

        val globalHeaders = MongoColumnName("globalHeaders")

        /**
         * 最初拦截器
         */
        @nbcp.base.db.annotation.Cn(value = """最初拦截器""") 
        val firstScript = MongoColumnName("firstScript")

        /**
         * 请求拦截器
         */
        @nbcp.base.db.annotation.Cn(value = """请求拦截器""") 
        val requestScript = MongoColumnName("requestScript")

        /**
         * 响应拦截器
         */
        @nbcp.base.db.annotation.Cn(value = """响应拦截器""") 
        val responseScript = MongoColumnName("responseScript")

        val isActive = MongoColumnName("isActive")

        /**
         * 备注
         */
        @nbcp.base.db.annotation.Cn(value = """备注""") 
        val remark = MongoColumnName("remark")

        val createBy = IdNameMeta("createBy")

        val updateBy = IdNameMeta("updateBy")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * Api故事
     */
    @nbcp.base.db.annotation.Cn(value = """Api故事""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class ApiStoryEntity(collectionName: String = "apiStory") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.ApiStory>(nancal.mp.db.mongo.entity.dev.ApiStory::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val name = MongoColumnName("name")

        val productLine = IdCodeNameMeta("productLine")

        /**
         * api地址
         */
        @nbcp.base.db.annotation.Cn(value = """api地址""") 
        val apiAddress = MongoColumnName("apiAddress")

        /**
         * Api
         */
        @nbcp.base.db.annotation.Cn(value = """Api""") 
        val apis = ApiInstanceIdMeta("apis")

        /**
         * 创建者
         */
        @nbcp.base.db.annotation.Cn(value = """创建者""") 
        val createBy = IdNameMeta("createBy")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }


    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class AppDeployPipelineHookEntity(collectionName: String = "appDeployPipelineHook") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.AppDeployPipelineHook>(nancal.mp.db.mongo.entity.dev.AppDeployPipelineHook::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val name = MongoColumnName("name")

        val language = MongoColumnName("language")

        val define = JenkinsDependencyCheckDefineMeta("define")

        val remark = MongoColumnName("remark")

        val sort = MongoColumnName("sort")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * 应用部署设置服务器
     */
    @nbcp.base.db.annotation.Cn(value = """应用部署设置服务器""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    @nbcp.base.db.annotation.DbEntityIndexes(value = arrayOf(nbcp.base.db.annotation.DbEntityIndex(value = arrayOf("""code"""), unique = true)))
    class AppDeploySettingEntity(collectionName: String = "appDeploySetting") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.AppDeploySetting>(nancal.mp.db.mongo.entity.dev.AppDeploySetting::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val name = MongoColumnName("name")

        val code = MongoColumnName("code")

        val corpName = MongoColumnName("corpName")

        val corpLogo = MongoColumnName("corpLogo")

        val corpIcon = MongoColumnName("corpIcon")

        val systemName = MongoColumnName("systemName")

        val loginPage = MongoColumnName("loginPage")

        val jenkinsServer = JenkinsServerMeta("jenkinsServer")

        val k8sConfig = K8sConfigMeta("k8sConfig")

        val mpIntegrationApiHost = MongoColumnName("mpIntegrationApiHost")

        val adminToken = MongoColumnName("adminToken")

        val nexusServer = NexusServerConfigMeta("nexusServer")

        val dockerBuildHosts = HostIPMeta("dockerBuildHosts")

        val packageTool = MongoColumnName("packageTool")

        /**
         * Harbor域名
         */
        @nbcp.base.db.annotation.Cn(value = """Harbor域名""") 
        val harborServer = HarborServerConfigMeta("harborServer")

        val pipelineTemplate = MongoColumnName("pipelineTemplate")

        val dockerApiUrl = MongoColumnName("dockerApiUrl")

        val profile = MongoColumnName("profile")

        val clusterDeployEnv = MongoColumnName("clusterDeployEnv")

        /**
         * 部署语言设置
         */
        @nbcp.base.db.annotation.Cn(value = """部署语言设置""") 
        val languageSettings = DeployLanguageSettingMeta("languageSettings")

        val javaOpts = MongoColumnName("javaOpts")

        val javaArgs = MongoColumnName("javaArgs")

        val serviceNameStyle = MongoColumnName("serviceNameStyle")

        val snapshotVersionAction = MongoColumnName("snapshotVersionAction")

        val dockerEnvTimezone = MongoColumnName("dockerEnvTimezone")

        val removeNpmLock = MongoColumnName("removeNpmLock")

        val remark = MongoColumnName("remark")

        val isActive = MongoColumnName("isActive")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

        fun queryByCode(code: String): MongoQueryClip<AppDeploySettingEntity, nancal.mp.db.mongo.entity.dev.AppDeploySetting> {
            return this.query().where { it.code mongoEquals code }
        }


        fun deleteByCode(code: String): MongoDeleteClip<AppDeploySettingEntity> {
            return this.delete().where { it.code mongoEquals code }
        }

        fun updateByCode(code: String): MongoUpdateClip<AppDeploySettingEntity, nancal.mp.db.mongo.entity.dev.AppDeploySetting> {
            return this.update().where { it.code mongoEquals code }
        }
        
        

    }

    /**
     * 集群
     */
    @nbcp.base.db.annotation.Cn(value = """集群""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    @nbcp.base.db.annotation.DbEntityIndexes(value = arrayOf(nbcp.base.db.annotation.DbEntityIndex(value = arrayOf("""code"""), unique = true)))
    class ClusterInfoEntity(collectionName: String = "clusterInfo") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.ClusterInfo>(nancal.mp.db.mongo.entity.dev.ClusterInfo::class.java, collectionName) {

        val id = MongoColumnName("_id")

        /**
         * 名称
         */
        @nbcp.base.db.annotation.Cn(value = """名称""") 
        val name = MongoColumnName("name")

        /**
         * 编码
         */
        @nbcp.base.db.annotation.Cn(value = """编码""") 
        val code = MongoColumnName("code")

        /**
         * 序号
         */
        @nbcp.base.db.annotation.Cn(value = """序号""") 
        val index = MongoColumnName("index")

        /**
         * 备注
         */
        @nbcp.base.db.annotation.Cn(value = """备注""") 
        val remark = MongoColumnName("remark")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

        fun queryByCode(code: String): MongoQueryClip<ClusterInfoEntity, nancal.mp.db.mongo.entity.dev.ClusterInfo> {
            return this.query().where { it.code mongoEquals code }
        }


        fun deleteByCode(code: String): MongoDeleteClip<ClusterInfoEntity> {
            return this.delete().where { it.code mongoEquals code }
        }

        fun updateByCode(code: String): MongoUpdateClip<ClusterInfoEntity, nancal.mp.db.mongo.entity.dev.ClusterInfo> {
            return this.update().where { it.code mongoEquals code }
        }
        
        

    }

    /**
     * 枚举
     */
    @nbcp.base.db.annotation.Cn(value = """枚举""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class DataEnumEntity(collectionName: String = "dataEnum") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.DataEnum>(nancal.mp.db.mongo.entity.dev.DataEnum::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val name = MongoColumnName("name")

        /**
         * 产品线
         */
        @nbcp.base.db.annotation.Cn(value = """产品线""") 
        val productLine = CodeNameMeta("productLine")

        /**
         * 应用
         */
        @nbcp.base.db.annotation.Cn(value = """应用""") 
        val app = MongoColumnName("app")

        val cnName = MongoColumnName("cnName")

        /**
         * 字段
         */
        @nbcp.base.db.annotation.Cn(value = """字段""") 
        val items = KeyValueStringMeta("items")

        val remark = MongoColumnName("remark")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * Api模型
     */
    @nbcp.base.db.annotation.Cn(value = """Api模型""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class DataModelEntity(collectionName: String = "dataModel") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.DataModel>(nancal.mp.db.mongo.entity.dev.DataModel::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val name = MongoColumnName("name")

        /**
         * 产品线
         */
        @nbcp.base.db.annotation.Cn(value = """产品线""") 
        val productLine = CodeNameMeta("productLine")

        /**
         * 应用
         */
        @nbcp.base.db.annotation.Cn(value = """应用""") 
        val app = MongoColumnName("app")

        val cnName = MongoColumnName("cnName")

        val define = ApiBodyParameterDefineMeta("define")

        val tableView = MongoColumnName("tableView")

        val logicParent = IdNameMeta("logicParent")

        val inheritParent = IdNameMeta("inheritParent")

        val apis = ApiDefineMeta("apis")

        val remark = MongoColumnName("remark")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * 关系型数据连接
     */
    @nbcp.base.db.annotation.Cn(value = """关系型数据连接""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class DbConnectionEntity(collectionName: String = "dbConnection") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.DbConnection>(nancal.mp.db.mongo.entity.dev.DbConnection::class.java, collectionName) {

        val id = MongoColumnName("_id")

        /**
         * 名称
         */
        @nbcp.base.db.annotation.Cn(value = """名称""") 
        val name = MongoColumnName("name")

        val code = MongoColumnName("code")

        /**
         * 数据库类型
         */
        @nbcp.base.db.annotation.Cn(value = """数据库类型""") 
        val type = MongoColumnName("type")

        /**
         * Ip
         */
        @nbcp.base.db.annotation.Cn(value = """Ip""") 
        val host = MongoColumnName("host")

        /**
         * 端口
         */
        @nbcp.base.db.annotation.Cn(value = """端口""") 
        val port = MongoColumnName("port")

        /**
         * 用户名
         */
        @nbcp.base.db.annotation.Cn(value = """用户名""") 
        val userName = MongoColumnName("userName")

        /**
         * 密码
         */
        @nbcp.base.db.annotation.Cn(value = """密码""") 
        val password = MongoColumnName("password")

        /**
         * 数据库名
         */
        @nbcp.base.db.annotation.Cn(value = """数据库名""") 
        val dbName = MongoColumnName("dbName")

        /**
         * 备注
         */
        @nbcp.base.db.annotation.Cn(value = """备注""") 
        val remark = MongoColumnName("remark")

        /**
         * 组定义, key=table,value=组
         */
        @nbcp.base.db.annotation.Cn(value = """组定义, key=table,value=组""") 
        val groupMap = MongoColumnName("groupMap")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * 发布单
     */
    @nbcp.base.db.annotation.Cn(value = """发布单""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class DeploySheetEntity(collectionName: String = "deploySheet") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.DeploySheet>(nancal.mp.db.mongo.entity.dev.DeploySheet::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val name = MongoColumnName("name")

        val remark = MongoColumnName("remark")

        val productLine = IdCodeNameMeta("productLine")

        val status = MongoColumnName("status")

        val items = DeployItemMeta("items")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }


    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class DevopsTemplateFileEntity(collectionName: String = "devopsTemplateFile") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.DevopsTemplateFile>(nancal.mp.db.mongo.entity.dev.DevopsTemplateFile::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val language = MongoColumnName("language")

        val fileName = MongoColumnName("fileName")

        val content = MongoColumnName("content")

        val remark = MongoColumnName("remark")

        val createBy = IdNameMeta("createBy")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * Es数据连接
     */
    @nbcp.base.db.annotation.Cn(value = """Es数据连接""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class EsConnectionEntity(collectionName: String = "esConnection") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.EsConnection>(nancal.mp.db.mongo.entity.dev.EsConnection::class.java, collectionName) {

        val id = MongoColumnName("_id")

        /**
         * 名称
         */
        @nbcp.base.db.annotation.Cn(value = """名称""") 
        val name = MongoColumnName("name")

        val code = MongoColumnName("code")

        /**
         * Ip
         */
        @nbcp.base.db.annotation.Cn(value = """Ip""") 
        val host = MongoColumnName("host")

        /**
         * 端口
         */
        @nbcp.base.db.annotation.Cn(value = """端口""") 
        val port = MongoColumnName("port")

        /**
         * 用户名
         */
        @nbcp.base.db.annotation.Cn(value = """用户名""") 
        val userName = MongoColumnName("userName")

        /**
         * 密码
         */
        @nbcp.base.db.annotation.Cn(value = """密码""") 
        val password = MongoColumnName("password")

        /**
         * 备注
         */
        @nbcp.base.db.annotation.Cn(value = """备注""") 
        val remark = MongoColumnName("remark")

        /**
         * 表元数据定义
         */
        @nbcp.base.db.annotation.Cn(value = """表元数据定义""") 
        val tableMetas = MongoColumnName("tableMetas")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * Git仓库
     */
    @nbcp.base.db.annotation.Cn(value = """Git仓库""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    @nbcp.base.db.annotation.DbEntityIndexes(value = arrayOf(nbcp.base.db.annotation.DbEntityIndex(value = arrayOf("""updateAt"""))))
    class GitDataEntity(collectionName: String = "gitData") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.GitData>(nancal.mp.db.mongo.entity.dev.GitData::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val name = MongoColumnName("name")

        /**
         * 集群
         */
        @nbcp.base.db.annotation.Cn(value = """集群""") 
        val clusterCode = MongoColumnName("clusterCode")

        /**
         * server
         */
        @nbcp.base.db.annotation.Cn(value = """server""") 
        val server = IdNameUrlMeta("server")

        /**
         * accessToken
         */
        @nbcp.base.db.annotation.Cn(value = """accessToken""") 
        val accessToken = MongoColumnName("accessToken")

        /**
         * 语言
         */
        @nbcp.base.db.annotation.Cn(value = """语言""") 
        val language = MongoColumnName("language")

        /**
         * 开发语言的版本，如 1.8,11,17
         */
        @nbcp.base.db.annotation.Cn(value = """开发语言的版本，如 1.8,11,17""") 
        val languageVersion = MongoColumnName("languageVersion")

        /**
         * 是否是lib库
         */
        @nbcp.base.db.annotation.Cn(value = """是否是lib库""") 
        val isLib = MongoColumnName("isLib")

        /**
         * Git路径
         */
        @nbcp.base.db.annotation.Cn(value = """Git路径""") 
        val path = MongoColumnName("path")

        /**
         * 子文件夹
         */
        @nbcp.base.db.annotation.Cn(value = """子文件夹""") 
        val folders = GitFolderDataMeta("folders")

        /**
         * 产品线
         */
        @nbcp.base.db.annotation.Cn(value = """产品线""") 
        val productLine = IdCodeNameMeta("productLine")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * Git发版锁定
     */
    @nbcp.base.db.annotation.Cn(value = """Git发版锁定""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class GitFolderDeployLockEntity(collectionName: String = "gitFolderDeployLock") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.GitFolderDeployLock>(nancal.mp.db.mongo.entity.dev.GitFolderDeployLock::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val gitDataId = MongoColumnName("gitDataId")

        val folder = MongoColumnName("folder")

        val lockBranch = MongoColumnName("lockBranch")

        val lockBy = IdNameMeta("lockBy")

    }

    /**
     * Git服务器
     */
    @nbcp.base.db.annotation.Cn(value = """Git服务器""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class GitServerEntity(collectionName: String = "gitServer") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.GitServer>(nancal.mp.db.mongo.entity.dev.GitServer::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val name = MongoColumnName("name")

        val code = MongoColumnName("code")

        /**
         * 地址
         */
        @nbcp.base.db.annotation.Cn(value = """地址""") 
        val host = MongoColumnName("host")

        val userName = MongoColumnName("userName")

        val password = MongoColumnName("password")

        val gitServerType = MongoColumnName("gitServerType")

        /**
         * Git访问令牌
         */
        @nbcp.base.db.annotation.Cn(value = """Git访问令牌""") 
        val accessToken = MongoColumnName("accessToken")

        /**
         * jenkins中的credential
         */
        @nbcp.base.db.annotation.Cn(value = """jenkins中的credential""") 
        val jenkinsCredential = MongoColumnName("jenkinsCredential")

        /**
         * 备注
         */
        @nbcp.base.db.annotation.Cn(value = """备注""") 
        val remark = MongoColumnName("remark")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }


    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    @nbcp.base.db.annotation.DbEntityIndexes(value = arrayOf(nbcp.base.db.annotation.DbEntityIndex(value = arrayOf("""createAt"""))))
    class JenkinsLogEntity(collectionName: String = "jenkinsLog") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.JenkinsLog>(nancal.mp.db.mongo.entity.dev.JenkinsLog::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val status = MongoColumnName("status")

        val stages = JenkinsLogItemDataMeta("stages")

        val gitData = GitDataMeta("gitData")

        val sourceData = SourceDataMeta("sourceData")

        val buildInfo = JenkinsBuildInfoMeta("buildInfo")

        val buildVersion = JenkinsBuildDetailInfoMeta("buildVersion")

        val createBy = IdNameMeta("createBy")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }


    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    @nbcp.base.db.annotation.DbEntityIndexes(value = arrayOf(nbcp.base.db.annotation.DbEntityIndex(value = arrayOf("""createAt"""))))
    class JenkinsOpsLogEntity(collectionName: String = "jenkinsOpsLog") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.JenkinsOpsLog>(nancal.mp.db.mongo.entity.dev.JenkinsOpsLog::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val namespace = MongoColumnName("namespace")

        val k8sServices = MongoColumnName("k8sServices")

        val size = MongoColumnName("size")

        val mongo = DbSettingMeta("mongo")

        val mysql = DbSettingMeta("mysql")

        val targetEnv = MongoColumnName("targetEnv")

        val buildNumber = MongoColumnName("buildNumber")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * Mongo数据连接
     */
    @nbcp.base.db.annotation.Cn(value = """Mongo数据连接""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class MongoConnectionEntity(collectionName: String = "mongoConnection") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.MongoConnection>(nancal.mp.db.mongo.entity.dev.MongoConnection::class.java, collectionName) {

        val id = MongoColumnName("_id")

        /**
         * 名称
         */
        @nbcp.base.db.annotation.Cn(value = """名称""") 
        val name = MongoColumnName("name")

        /**
         * 编码
         */
        @nbcp.base.db.annotation.Cn(value = """编码""") 
        val code = MongoColumnName("code")

        /**
         * Ip
         */
        @nbcp.base.db.annotation.Cn(value = """Ip""") 
        val host = MongoColumnName("host")

        /**
         * 端口
         */
        @nbcp.base.db.annotation.Cn(value = """端口""") 
        val port = MongoColumnName("port")

        /**
         * 用户名
         */
        @nbcp.base.db.annotation.Cn(value = """用户名""") 
        val userName = MongoColumnName("userName")

        /**
         * 密码
         */
        @nbcp.base.db.annotation.Cn(value = """密码""") 
        val password = MongoColumnName("password")

        /**
         * 数据库名
         */
        @nbcp.base.db.annotation.Cn(value = """数据库名""") 
        val dbName = MongoColumnName("dbName")

        /**
         * 备注
         */
        @nbcp.base.db.annotation.Cn(value = """备注""") 
        val remark = MongoColumnName("remark")

        /**
         * 表元数据定义
         */
        @nbcp.base.db.annotation.Cn(value = """表元数据定义""") 
        val tableMetas = MongoColumnName("tableMetas")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * 应用部署设置服务器
     */
    @nbcp.base.db.annotation.Cn(value = """应用部署设置服务器""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class OpsBuildQueueEntity(collectionName: String = "opsBuildQueue") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.OpsBuildQueue>(nancal.mp.db.mongo.entity.dev.OpsBuildQueue::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val name = MongoColumnName("name")

        val gitId = MongoColumnName("gitId")

        val targetEnv = MongoColumnName("targetEnv")

        val clusterCode = MongoColumnName("clusterCode")

        val gitBranch = MongoColumnName("gitBranch")

        val createBy = IdNameMeta("createBy")

        val startAt = MongoColumnName("startAt")

        val doneAt = MongoColumnName("doneAt")

        val msg = MongoColumnName("msg")

        val status = MongoColumnName("status")

    }

    /**
     * 参数模型
     */
    @nbcp.base.db.annotation.Cn(value = """参数模型""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class ParameterModelEntity(collectionName: String = "parameterModel") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.ParameterModel>(nancal.mp.db.mongo.entity.dev.ParameterModel::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val name = MongoColumnName("name")

        /**
         * 产品线
         */
        @nbcp.base.db.annotation.Cn(value = """产品线""") 
        val productLine = CodeNameMeta("productLine")

        /**
         * 应用
         */
        @nbcp.base.db.annotation.Cn(value = """应用""") 
        val app = MongoColumnName("app")

        val cnName = MongoColumnName("cnName")

        val define = ApiBodyParameterDefineMeta("define")

        val remark = MongoColumnName("remark")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

    /**
     * 产品线
     */
    @nbcp.base.db.annotation.Cn(value = """产品线""")
    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    @nbcp.base.db.annotation.DbEntityIndexes(value = arrayOf(nbcp.base.db.annotation.DbEntityIndex(value = arrayOf("""code"""), unique = true)))
    class ProductLineEntity(collectionName: String = "productLine") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.ProductLine>(nancal.mp.db.mongo.entity.dev.ProductLine::class.java, collectionName) {

        val id = MongoColumnName("_id")

        /**
         * 产品线名称
         */
        @nbcp.base.db.annotation.Cn(value = """产品线名称""") 
        val name = MongoColumnName("name")

        /**
         * 编码
         */
        @nbcp.base.db.annotation.Cn(value = """编码""") 
        val code = MongoColumnName("code")

        /**
         * 备注
         */
        @nbcp.base.db.annotation.Cn(value = """备注""") 
        val remark = MongoColumnName("remark")

        /**
         * 产品经理
         */
        @nbcp.base.db.annotation.Cn(value = """产品经理""") 
        val lm = IdNameMeta("lm")

        /**
         * 项目经理
         */
        @nbcp.base.db.annotation.Cn(value = """项目经理""") 
        val pm = IdNameMeta("pm")

        /**
         * 开发经理
         */
        @nbcp.base.db.annotation.Cn(value = """开发经理""") 
        val leader = IdNameMeta("leader")

        /**
         * 开发人员
         */
        @nbcp.base.db.annotation.Cn(value = """开发人员""") 
        val developers = IdNameMeta("developers")

        /**
         * 集群
         */
        @nbcp.base.db.annotation.Cn(value = """集群""") 
        val cluster = IndexCodeNameMeta("cluster")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

        fun queryByCode(code: String): MongoQueryClip<ProductLineEntity, nancal.mp.db.mongo.entity.dev.ProductLine> {
            return this.query().where { it.code mongoEquals code }
        }


        fun deleteByCode(code: String): MongoDeleteClip<ProductLineEntity> {
            return this.delete().where { it.code mongoEquals code }
        }

        fun updateByCode(code: String): MongoUpdateClip<ProductLineEntity, nancal.mp.db.mongo.entity.dev.ProductLine> {
            return this.update().where { it.code mongoEquals code }
        }
        
        

    }


    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class UserDockerfileEntity(collectionName: String = "userDockerfile") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.UserDockerfile>(nancal.mp.db.mongo.entity.dev.UserDockerfile::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val name = MongoColumnName("name")

        val language = MongoColumnName("language")

        val languageVersion = MongoColumnName("languageVersion")

        val templateContent = MongoColumnName("templateContent")

        val editors = EditorDataMeta("editors")

        val dockerfile = MongoColumnName("dockerfile")

        /**
         * 备注
         */
        @nbcp.base.db.annotation.Cn(value = """备注""") 
        val remark = MongoColumnName("remark")

        val createBy = IdNameMeta("createBy")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }


    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """dev""")
    class UserK8sDeploymentEntity(collectionName: String = "userK8sDeployment") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.dev.UserK8sDeployment>(nancal.mp.db.mongo.entity.dev.UserK8sDeployment::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val name = MongoColumnName("name")

        val language = MongoColumnName("language")

        val languageVersion = MongoColumnName("languageVersion")

        val templateContent = MongoColumnName("templateContent")

        val editors = EditorDataMeta("editors")

        val yaml = MongoColumnName("yaml")

        /**
         * 备注
         */
        @nbcp.base.db.annotation.Cn(value = """备注""") 
        val remark = MongoColumnName("remark")

        val createBy = IdNameMeta("createBy")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

}

